<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../../houtai/include/peizhi.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link rel="shortcut icon" type="image/x-icon" href="${ctx}/images/favicon.ico" />
	<meta name="title" content="${titleVo.title}">
	<meta name="keywords" content="${titleVo.keyword}">
	<meta name="description" content="${titleVo.content}">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<link rel="stylesheet" type="text/css" href="${ctx}/css/basepc.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/css/index.css">
	<link rel="stylesheet" href="${ctx}/css/admin.css" /> 
	<script type="text/javascript" src="${ctx}/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${ctx}/js/list.js"></script>
	<script type="text/javascript" src="${ctx}/js/epagehoutai.js"></script>
	<title></title>
<style type="text/css">
	.choice {
    width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    background-color: #f0f0f0;
}
</style>
</head>
<body>
<form id="pageForm" action="${ctx}/list/getList">
	<div class="home-top" style="_height:10rem;min-height:10rem;background-image: none;height: 0px;">
		<jsp:include page="/WEB-INF/views/qiantai/e/include/head.jsp" />
			<div class="choice">
				<table style="vertical-align:middle;" width="100%" border="1">
					<tr height="70rem">
						<td>select site：
							<select name="cState" id="cState" style="width:100px;">
				         		<option value="亚洲">Asia</option>
				         		<option value="欧洲">Europe</option>
				         		<option value="北美洲">North America</option>
				         		<option value="南美洲">South America</option>
				         		<option value="非洲">Africa</option>
				         		<option value="大洋洲">Oceania</option>
				         		<option value="南极洲">Antarctica</option>
				         	</select>
				         	<select name="cCountry" id="cCountry" style="width:100px;">
				         		<option value="请选择">Please select</ption>
				         	</select>
				         	<select name="cCity" id="cCity" style="width:100px;">
				         		<option value="${cCity==null ? '请选择':cCity}">${cCity==null ? 'Please select':eCity}</option>
				         	</select>
						</td>
					</tr>
				</table>
			</div>
		<div class="home-ui">
		</div>
	</div>
	<div class="w1200">
		<div class="home-tap">
			<table style="vertical-align:middle; text-align:center;" width="100%" border="1" cellspacing="0" cellpadding="0">
				<tr   height="70rem">
					<td width='70rem'>logo</td>
					<td width='70rem'>name</td>
					<td width='70rem'>introduce</td>
				</tr>
			</table>
				<input type="hidden" name="pageNo" id="pageNo" value="0" /> 
				<input type="hidden" name="pageSize" id="pageSize" value="10" /> 
				<input id='lastPage' type="hidden">
			<table id='pagehtml' style="vertical-align:middle;  text-align:center;" width="100%" border="1" cellspacing="0" cellpadding="0">
			</table>
			<table id='pagehtml1' style="vertical-align:middle;  text-align:center;" width="100%" border="1" cellspacing="0" cellpadding="0">
			</table>	
		</div>
	</div>
<jsp:include page="/WEB-INF/views/qiantai/e/include/foot.jsp"/>
</form>
<script type="text/javascript">
	//地区查询
	function getRegion(t,s){
		var prem = "cState="+($('#cState').val()==''?'亚洲':$('#cState').val())
			+"&cCountry="+$('#cCountry').val()
			+"&cCity="+$('#cCity').val()
			+"&type="+t;
			/* alert(prem); */
		$.ajax({
			url:"${ctx}/list/region/getlist",
			type:"post",
			data:prem,
			success:function(data){
				//var list =eval("("+data+")");  
				var html = '<option value="请选择">Please select</option>';
				if(data!=null && data.length>0){
					for (var i = 0; i < data.length; i++) {
						if(s=='0'){
							html = html + '<option value="'+data[i].cCountry+'">'+data[i].eCountry+'</option>';
						}
						if(s=='1'){
							html = html + '<option value="'+data[i].cCity+'">'+data[i].eCity+'</option>';
						}
					}
				}
				if(s=='0'){
					$("#cCountry").html(html);
				}
				if(s=='1'){
					$("#cCity").html(html);
				}
			}
		});
	}
	$('#cState').change(function () {//选择洲的时候执行的
		getRegion('0','0');
		page(0,$("#pageSize").val());
	});
	$('#cCountry').change(function () {//选择国家的时候执行的
		getRegion('1','1');
		page(0,$("#pageSize").val());
	});
	$('#cCity').change(function () {//选择城市的时候执行的
		page(0,$("#pageSize").val());
	});
	var listhtml = "<tr height='70rem' >";
			  listhtml = listhtml + "<td style='border:#cccccc solid 1px;' width='70rem'><a href='/content?e=e&ss=1&id={3}'><img style='max-width:40%;' src='${ctx}/upload/img/{0}' alt='' /></a></td>";
			  listhtml = listhtml + "<td style='border:#cccccc solid 1px;' width='70rem'>{1}</td>";
			  listhtml = listhtml + "<td style='border:#cccccc solid 1px;' width='70rem'>{2}</td>";
			  listhtml = listhtml + "</tr>";
		function pageAppend(data){
			return listhtml.replace('{0}',data.headimg)
			.replace('{1}',data.etitle)
			.replace('{2}',data.econtent.substring(0,10))
			.replace('{3}',data.id);
		}
	getRegion('0','0');
	page(parseInt($("#pageNo").val())+1,$("#pageSize").val());
</script>
</body>
</html>